<?php
class Products extends UaModel {
	
	var $name = "Product";
	var $common_cols = "sort_id AS ProductSortId,Product.sn AS SerialNumber,Product.id AS ID,industry_id AS IndustryID,Product.name AS Name,Product.picture AS ProductPicture,content AS Description,Product.created AS CreateDate,Product.status AS ProductStatus,Product.state AS ProductState,html_file_id AS HtmlFileId";
	var $industry_cols = "Product.id,Product.member_id as MemberId,Product.id AS ProductId,Product.name AS Name,Product.name AS ProductName,Product.content AS Content,Product.industry_id AS IndustryID,Product.picture,Product.created,Product.keywords AS ProductKeywords,Industry.parentid AS IndustryParentid,Industry.name AS IndustryName";
	var $product_sorts = array (1 => "最新产品", 2 => "普通商品", 3 => "库存商品" );
	var $check_status = array (0 => "等待审核", 1 => "有效信息", 2 => "审核不通过", 3 => "无效" );
	var $product_priority = array (0 => "团队线路", 1 => "自由度假套餐", 2 => "半自由度假", 3 => "完全自由度假" );
	var $product_commends = array (0 => "普通线路", 1 => "海报推荐", 2 => "特价线路(首)", 3 => "专家主题推荐", 4 => "玩转主题", 5 => "热门线路(团)", 6 =>
  "最佳线路(团)/最佳目的地(自)", 7 => "最新线路(团)", 8 => "精品线路(首)", 9 => "IP城市推荐(首)");
	
	function Products() {
	
	}
	
	function checkProducts($id = null, $status = null) {
		if (is_array ( $id )) {
			$checkId = "id in (" . implode ( ",", $id ) . ")";
		} else {
			$checkId = "id=" . $id;
		}
		$sql = "UPDATE " . $this->getTable () . " SET status=" . $status . " WHERE " . $checkId;
		$return = $GLOBALS ['g_db']->Execute ( $sql );
		if ($return) {
			return true;
		} else {
			return false;
		}
	}
}
?>
